# -*- coding: UTF-8 -*-
# @Time : 2022/1/17 0017 17:33
# @Author : lyw
# @Remark :
import time

from mxsoftpy import Model
from pydantic import validator


class GetRECDoorModel(Model):
    host: str
    model_id: str

    @validator('host')
    def check_host(cls, value):
        assert value != "", "host参数不存在..."
        return value


class DoorModel(Model):
    auth_method: str
    origin_id: str
    device_id: str
    host: str
    is_del: int = 0
    label: str
    create_time: int = int(time.time())
    update_time: int = 0
    rec_id: str
    model_id: str
